#pragma once

#include "scubserver.h"
#include "Method.h"
#include<vector>

struct Unolyzer :
    public Scubserver
{
private:
    std::vector<Method*> m_apxMethod;
    Scope m_xCurrentScope;
    Method * m_pxMethod;
    int m_nDepthMax;

private:
    void onEntryParen(Scope& inOldScope);
    void onEntryBlock(Scope& inOldScope);
    void onEntryComment(Scope& inOldScope);
     
    void onExitToGlobal(Scope& inOldScope);
    void onExitToBlock(Scope& inOldScope);

    void onGlobalFromParen(Scope& inOldScope);

public:
    virtual void onNewToken(Token& inToken);
    virtual void onScopeEntry(Scope& inNewScope, Scope& inOldScope);
    virtual void onScopeExit(Scope& inNewScope, Scope& inOldScope);
    void dump(bool in_bVerbose=false);
    Unolyzer(void);
    ~Unolyzer(void);
};
